class Simulation < ActiveRecord::Base
  belongs_to :system
  has_one :integration_parameter
  has_one :small_body_parameter
  has_many :simulation_bodies
  validates_uniqueness_of :name
  
  def self.included_planets(simulation_id)
		body_type_id = BodyType.find(:first, :conditions => { :name => 'planet' }).id
		SimulationBody.find(:all, :conditions => { :simulation_id => simulation_id, :body_type_id => body_type_id })
	end
end
